﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/User.Master" AutoEventWireup="true" CodeBehind="DashBoard.aspx.cs" Inherits="CRMWeb.Pages.DashBoard" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div id="pnlapptitles" class="easyui-panel master_content" style="width: 1150px; height: 895px; background-color: #d6e3bc">
        <div data-options="region:'center'" style="height: auto;">
            <table cellspacing="0" selectionmode="single" class="history_table" style="padding-left: 50px; padding-top: 50px;" cellpadding="0" border="0">
                <tr>
                    <td style="width: 150px; vertical-align: top;">
                        <table id="dgNoticeDashboard" style="width: 360px; height: 340px;"
                            pagination="false" data-options="pageSize:20"
                            rownumbers="true" fitcolumns="true" singleselect="true" autorowheight="true">
                            <thead>
                                <tr>
                                    <th field="NoticeTitle" width="20" data-options="formatter:SetFormatedText">Title</th>
                                    <th field="Edit_Date" width="15">Last Edit Date</th>
                                </tr>
                            </thead>
                        </table>
                    </td>
                    <td style="width: 58%; vertical-align: top; padding-left: 5px;">
                        <div id="divShowDes" class="easyui-panel" title="Notice Description" style="height: 340px; width: 370px; padding-left: 7px; padding-right: 7px; padding-bottom: 7px; padding-top: 7px;">
                        </div>
                    </td>
                </tr>
            </table>
            <input type="hidden" id="hdnRole" runat="server" />
        </div>
    </div>
    <script type="text/javascript">

        var setUserRole = '';
        fnLeftNavSelected('A5');

        $(document).ready(function () {
            SetTagName();

        });

        function SetTagName() {
            document.title = 'CRM - Dashboard';
        }


        //Show formated column value with tooltip
        function SetFormatedText(cellvalue, options, rowObject)
        {
            if (cellvalue.length >= 25)
            {
                return '<span style="width: 50%;Height:60%"  title="' + cellvalue + '" class="easyui-tooltip">' + cellvalue.substring(0, 22) + '...' + '</span>';
            }
            else
            {
                return '<span style="width: 50%;Height:60%"  title="' + cellvalue + '" class="easyui-tooltip">' + cellvalue + '</span>';
            }
        };

        function ShowRecentNotice() {
            $.ajax({
                url: "/WebServices/Notice.ashx?method=ShowLatestNotice",
                contentType: "application/json; charset=utf-8",
                success: function (data) {
                    $.each(eval(data.replace(/[\r\n]/, '')), function (i, rec) {

                        $('#txtNoticeDescription').panel({
                            title: rec.NoticeTitle,

                        });

                        var data = decodeURIComponent(rec.NoticeDescription);
                        $('#txtNoticeDescription').html(data);

                    });
                }
            });
        }
    </script>
</asp:Content>

